#include "game.h"
#include "ui_game.h"

game::game(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::game)
{
    ui->setupUi(this);
    this->setGeometry(QRect(600,300,780,600));//设定窗体大小和起始坐标
}

void game::paintEvent(QPaintEvent *event){
    QPainter painter(this);//画游戏背景
    painter.setPen(Qt::black);
    painter.setBrush(Qt::yellow);
    painter.drawRect(15,15,560,560);//外围
    painter.setPen(Qt::black);
    painter.setBrush(Qt::green);
    painter.drawRect(25,25,540,540);
}
game::~game()
{
    delete ui;
}
